package com.${ltdAbbr}.xiao.${module}.task.service;

import java.util.List;

import com.${ltdAbbr}.xiao.${module}.task.po.TaskTriggerBo;

public interface SchedulerService {

    /**
     * 获取当前定时任务列表
     * @return
     * @throws Exception 
     */
    public List<TaskTriggerBo> queryTaskList() throws Exception;

    /**
     * 暂停定时任务
     * @param groupName
     * @param triggerName
     * @throws Exception 
     */
    public void pause(TaskTriggerBo jobTrigger) throws Exception;

    /**
     * 恢复定时任务运行
     * @param groupName
     * @param triggerName
     * @throws Exception
     */
    public void resume(TaskTriggerBo jobTrigger) throws Exception;

    /**
     * 立即运行定时任务
     * @param groupName
     * @param jobName
     * @throws Exception
     */
    public void run(TaskTriggerBo jobTrigger) throws Exception;

    /**
     * 重设定时任务
     * 目前支持 [CronTriggerImpl, SimpleTriggerImpl, DailyTimeIntervalTriggerImpl, CalendarIntervalTriggerImpl] 共四种触发器定时任务
     * @param jobTrigger(groupName, triggerName, cronExpression||repeatInterval)
     * @throws Exception 
     */
    public void reset(TaskTriggerBo jobTrigger) throws Exception;

}
